<template>
    <div class="tab-bar-item">
        <div class="icon">
            <img
                v-show="!active"
                :src="require(`@/assets/icon/${item.icon}.png`)"
            />
            <img
                v-show="active"
                :src="require(`@/assets/icon/${item.activeIcon}.png`)"
            />
        </div>
        <div class="title" :class="{ 'title-active': active === true }">
            {{ item.title }}
        </div>
    </div>
</template>

<script>
export default {
    props: {
        item: Object,
        active: {
            type: Boolean,
            default: false
        }
    },
    computed: {
        fontColor() {
            return this.active ? "#FFD101" : "#4e4e4";
        }
    },
    data() {
        return {};
    },

    methods: {}
};
</script>


<style lang="less" scoped>
.tab-bar-item {
    text-align: center;
    padding: 10px 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;

    .icon {
        font-size: 0;
        img {
            width: 50px;
        }
    }

    .title {
        color: #666;
        font-size: 26px;
    }
    .title-active {
        font-weight: 700;
        color: #ffc031;
    }
}
</style>